Skip to content

feat(workforce, core, engine): every worker on one shared copy of its flow (FIX-1788 P4) - #2866

Merged
jhoffner merged 12 commits into
mainfrom
fix/FIX-1788-p4
Oct 8, 2026
Merged

jhoffner merged 12 commits into
mainfrom
fix/FIX-1788-p4

Conversation

@jhoffner

@jhoffner jhoffner commented Oct 8, 2026 •

Copy link
Copy Markdown
Collaborator

The problem

Today every worker a user hires is its own registered copy of a flow, pinned to its owner. A hire or a fire reaches other processes only after a restart, and the copy-per-worker model is what FIX-1788's privacy work replaces: a worker should be data its owner holds, run by one shared copy of the flow it names. P1 and P2 built the parts beside today's model; nothing switched over yet.

What this does

This is the switch. Every worker now runs on one copy of the flow it names. A user's own workers are rows in their own data, so a hire, fork or fire is seen by every process on the next turn, and nobody else can list, open, run or create a session with them. A session names its worker once, when it is created; every turn loads that worker.

  • What a worker's model reaches. On one shared copy, a new core rule (resourceVisibility) narrows each turn's model to the documents its own worker's file grants. Any other document answers exactly as one that doesn't exist, through every model-facing tool, an app's own included.
  • Private skills on agent. Each worker keeps its own skills drawer on the shared copy.
  • Sessions opened for a worker. Mailbox wakes and task hand-offs open a session that names the worker; a child session created for one worker is never reused for another.
  • Shift Manager. The DevTeam Lab runs one copy per worker flow and registers the roster flow, with fork and hire reachable through createWorkforceClient. Its Roster screen lists the signed-in person's own workers.
  • Removed. The per-worker hire, its boot reload and repair, the hired-roster collections, seat addresses and the pins Workforce set. No consumers yet, so old hires are dropped (epic D9).

What's asked of you

This implements the approved direction (FIX-1788 D3 to D7, approved by the product owner), with one call the product owner made during review: on the shared agent copy, long-term memory (episodic, semantic, digest) is kept per person, shared by that person's workers and never reaching another person. Skills are kept per worker, and working memory per conversation. BR-23 is being amended to match, and per-worker long-term memory on shared flows moves to a follow-up issue, FIX-1810. Nothing else here is yours to decide.

Parts worth reviewing closely

  • packages/core/src/tools/resource-tools.ts: reachableEntries is the one place the rule applies. Every listing, lookup, write target and the discovery door's resource source go through it. Check nothing model-facing still enumerates the registry around it.
  • packages/workforce/src/workers/installation.ts: the rule Workforce supplies (resourceVisibility), and the verified worker it reads. A turn that loaded no worker reaches no granted document.
  • packages/engine/src/context/create-request-host.ts and dispatch-run.ts: the adoption refusal (BR-18b). Only fields the dispatch names are compared.
  • packages/workforce/src/agent-worker-flow.ts: the worker is loaded in request.onStarted, so a resumed turn still runs as its worker; strict input refuses a turn that names one.
  • packages/workforce/src/worker-lookup.ts and mailbox/wake-member-seats.ts: board tasks and mailbox wakes reach standard workers only. See the engineering calls.

Spec · Linear FIX-1788 · epic FIX-1786 · milestone FIX-1805 (goal on #2864) · merges (last PR of the FIX-1788 stack; P1 #2850 and P2 #2856 are on main)

How to review this

How to review this. This implements an approved spec — the approach and the numbered decisions in its DECISIONS.md are already signed off by a human, so please review the code against that direction, not the direction itself. The canonical set is retained at specs/issues/FIX-1788/ on main; Linear links to it and the original merged spec PR, which keeps review history. Follow-up amendment PRs explain later direction changes. Current architecture docs remain the authority for shipped behavior (BP-037).

Most valuable here: correctness on the second path (the legacy shape, the null boundary, the concurrent case, the cancel path), anything deriving an auth or routing decision from caller-controllable input, and a behaviour the tests assert around rather than on.

Already settled upstream: the approach and every decision in the spec's DECISIONS.md (human-approved — if one is wrong, say so as a spec finding and it gets folded back; don't re-argue it inline), and the conventions in docs/contributing/best-practices.md.

Engineering calls
  • The rule's name and shape. defineFlow({ resourceVisibility: (ctx, { name, ref }) => "visible" | "read-only" | "hidden" }), definition-only, synchronous, naming no worker (D7 left the name to P4). It composes with llmReadable/llmWritable: it only narrows. A write to a read-only collection is refused as for a path no collection matches.
  • Board tasks and mailbox wakes reach standard workers only. A mailbox board is org-scoped and whoever drains it opens the task's session; the create check (BR-11) refuses that person naming another user's worker. A user's own workers get tasks through FIX-1794's per-conversation ledgers. The docs that promised "a worker the member hired a minute ago" are rewritten.
  • Shift Manager opens a conversation with createSession({ state: { workerId } }), not ensureWorkerSession. Its conversation rule (the newest direct session, FIX-1793 BR-14) excludes sessions a post or a run started; ensureWorkerSession returns the most recent match whichever started it. Same check, same refusals; the Roster lists through createWorkforceClient(...).roster(). useWorkforce lives in Shift Manager (src/lib/workforce.ts): react may not import workforce, nor workforce react. The public docs show the useMemo form.
  • Long-term memory on agent is per person (the product owner's decision). Per-worker long-term memory on a shared copy would need the memory package to take a key per turn, a framework change outside the epic's seven, so it is out of scope here and moves to a follow-up issue, FIX-1810. BR-23 is being amended to match: per-worker skills and per-conversation memory, with long-term memory per person. isolateUserState keeps its per-flow meaning and doesn't separate workers on the one copy; its doc comment, the built-in page and the README say so.
  • Kitchen-sink's mailbox working row names the worker the wake ran, read off the wake's key, since every worker's run on the one copy has flowId: agent. The E2E specs moved to the worker model: the rail opens agent into its one copy, a conversation starts from the roster panel's Talk, and which worker a conversation belongs to is read by the session's workerId.
  • Refusal wording that named the old API (hireWorkforce(workers, { references }), { documents }) now names createWorkerInstallation.
  • History. The WIP commits are regrouped into seven commits by package on top of main, then review fixes on top; intermediate commits of the first seven don't each typecheck (the workforce change breaks its consumers until their commit).
  • DOCS.md reconciled on publish, three deltas: the hire blocks are { hire, fork, edit, fire } and the roster flow (workforce-roster) comes registered from hireWorkforce, so an app defines no roster-admin flow; React builds the client with useMemo (no package hook); the visibility rule's real name is resourceVisibility.
Everything else

Against the P4 row

Surface Where
S7 on agent Each worker's skills drawer keyed by the turn's worker (agent-worker-flow.ts); BR-23 in agent-drawer-seeded-worker.test.ts and VG a:own-memory
S8 core resourceVisibility; Workforce supplies it from the verified worker; agent-grants-per-turn.test.ts, engine/test/resource-visibility.test.ts, V7 goal
S10 hireWorkforce(installation): one copy per flow plus the roster flow, no per-worker copy, no pin (V9: worker-registration.test.ts)
S11 Adoption refusal (BR-18b, session-birth.test.ts); wake keyed by worker; task lookup births the child naming its worker; writtenBy.workerId and mailbox lines signed by the turn's worker; the inventory lists standard workers only
S12 Roster lists the person's own workers (roster-screen.test.tsx, workforce.test.ts); conversations keyed by flow and worker (conversation.test.tsx, chief-of-staff.test.ts)
S14 Seat-hire capability and blocks, registerHiredSeat, boot reload, brokenSeats/rehire, hired-roster collections, seat addresses, listedSeatRows: removed
S15 kitchen-sink support desk and Shift Manager DevTeam on one copy per flow; goals rewritten or retired in goals/README.md, each naming the rule that replaced it
S16 Hiring and forking (replaces the runtime-hire page), Workers on disk (talking to a worker, the shared-copy contract, D6's section), Resources (resourceVisibility), every Workforce page's examples; READMEs; changesets: core minor, engine minor, workforce minor, shift-manager minor

Verification

The goal runs and checks below were re-run at 4f477d81e. The verdict-log rows in the goals were recorded at 9ea11deff; no code a goal reaches has changed since apart from Shift Manager's test and kitchen-sink's working row.

Check Command Result
VG pnpm tsx goals/workers-as-resources/keeps-each-users-workers-their-own/run.mts PASS, legs a and b
VG control GOAL_CONTROL=org-scoped-workers FAIL as required: b:reads-worker (Bob reads my-desk, scribe on his roster), b:create with it; leg a green
VG control GOAL_CONTROL=no-create-check FAIL as required: b:create (Bob's create naming Alice's scribe wrote a session), b:other-flow with it; leg a green
VG on main recorded in the goal's verdict log (ac39e7c14) FAIL: neither leg runs; main refuses agent as one copy for every worker ("seatId": Required)
V7 / BR-24 pnpm tsx goals/workforce-seats/a-seat-reaches-the-documents-its-file-names/run.mts (at 9ea11deff) PASS: one desk copy, three workers with different grants, each reaching only its own; another worker's document answers as a missing one through core's tools and the app's peek
V7 control GOAL_CONTROL=no-visibility-rule (at 9ea11deff) FAIL as required: the first worker's model lists the second's document: engineering.lead lists ["payroll"], with (b) to (e) red
FIX-1805 milestone GOAL_ONLY=milestone pnpm tsx goals/workforce-privacy/two-users-share-a-project-and-nothing-else/run.mts (goal from #2864, not committed here) PASS m1 to m5 on Shift Manager's DevTeam install, real model: Alice forks chief-of-staff through fork on workforce-roster and her Roster screen draws it; Bob is refused at every reach and his Roster doesn't draw it; Alice's second org sees none of it
Milestone control org-scoped-workers, run by the goal FAIL as required on m3 (Bob reads Alice's worker), m4 red with it, m5 green. The same goal on main (ea91beb49, #2864's log) failed m1: no workforce-roster flow
Typecheck pnpm typecheck pass
Tests pnpm --filter <pkg> test workforce 1217, core 2305, shift-manager 379 (+1 skipped): all pass. Earlier on this branch: orchestration 1671, kitchen-sink 188, fsdev 350, integration-tests 153 (+3 skipped), engine 3569 (one stream-conformance case timed out at 25 s under a parallel goal run; its file passes alone)
Kitchen-sink E2E playwright test against the test-mode build, no retries 24 of 24 pass. The working-row fix is red then green on talk-from-page "the routed specialist shows as working" (it read "agent is working")
conversation.test.tsx the file, 12 runs 0 failures (1 in 5 before the ported waitFor)
Docs pnpm --filter docs build builds, no broken links

🤖 Generated with Claude Code

https://claude.ai/code/session_01XMg2dz8sMEdyzCQTRsaMTV


Note

High Risk
This rewires workforce identity, session birth, and per-turn resource exposure—areas that gate multi-tenant privacy and dispatch correctness—with broad API removals and doc-driven behavior changes.

Overview
Workforce moves from one registered flow copy per worker to one shared copy per worker flow, with each user's hired/forked workers stored as user-scoped roster rows (workforce-roster actions and createWorkerInstallation / hireWorkforce(installation)). Sessions name a workerId at creation; turns load that worker and narrow model access via resourceVisibility in core (hidden/read-only/visible per resource). The engine refuses key-occupied adoption when a key-derived child session already exists with a different readonly state value instead of reusing it.

Removed the old seat-hire plane: per-seat registration pins, reloadHiredSeats, hired-roster collections, seatAddress, createSeatHireCapability, and related inventory/runtime-hire docs. Mailbox wakes and task lookup target standard workers only; Shift Manager registers installation flows and lists the signed-in user's roster.

Docs, changesets, goals/fixtures, and app wiring (kitchen-sink, DevTeam) are updated to match.

Reviewed by Cursor Bugbot for commit 4f477d8. Configure here.

claude added 8 commits October 8, 2026 01:40
…resource tools reach (FIX-1788 P4 S8)

A flow's optional resourceVisibility rule narrows every model-facing listing and lookup in core: the resource tools, search, the discover door's resource source, path and uri resolution. A hidden resource answers exactly as an unregistered one; a read-only one is read and not written. With no rule nothing changes. Generic: the rule names no worker (FIX-1788 D7, the epic's seventh Layer 1 mechanism).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XMg2dz8sMEdyzCQTRsaMTV
…donly value (FIX-1788 P4 S11, BR-18b)

A key-derived child that already exists with another value of a readonly session-state field than the dispatch names is refused key-occupied, naming the field, instead of running as the stored value. Covers the visibility rule end to end on the real engine too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XMg2dz8sMEdyzCQTRsaMTV
…oster and pins removed (FIX-1788 P4 S7 S8 S10 S11 S14)

hireWorkforce(installation) registers one copy of each worker flow and the roster flow, and mints nothing per worker. agent on an installation loads its turn's worker in request.onStarted, keeps each worker's skills drawer apart, narrows each turn's model to the worker's document grants through the installation's resourceVisibility, refuses a turn whose input names a worker, and signs mailbox posts as the turn's worker. The mailbox wake keys each member's conversation by worker and the task lookup births each task's session naming its worker, for standard workers. workerFlow(...) builds a flow kept in its own file on its installation. Removed: the seat-hire capability and blocks, registerHiredSeat, the boot reload and repair, the hired-roster collections, seat addresses and listedSeatRows.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XMg2dz8sMEdyzCQTRsaMTV
…ions name their worker (FIX-1788 P4 S12 S15)

Roster reads the signed-in person's roster through createWorkforceClient (useWorkforce) beside the standard workers. A seat's conversation is the person's newest session on its flow naming the worker, opened naming it before the first line. The DevTeam Lab, its fixtures and tests run one copy per worker flow, with hire and fire as the chief of staff's tools over the person's roster.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XMg2dz8sMEdyzCQTRsaMTV
…P4 S15)

The specialists are standard workers on one registered agent copy; the roster panel talks to workers through sessions that name them. The hire-plane admin flow and its reload report are gone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XMg2dz8sMEdyzCQTRsaMTV
…ane goals retired (FIX-1788 P4 S15, VG, V7)

goals/workers-as-resources/keeps-each-users-workers-their-own is the issue's goal, with its org-scoped-workers and no-create-check controls. The grants goal grades what each worker's model reaches on one copy, with a no-visibility-rule control. Goals that asserted a copy per worker move to the installation or are retired in goals/README.md, each naming the rule that replaced it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XMg2dz8sMEdyzCQTRsaMTV
…isibility (FIX-1788 P4 S16)

Hiring and forking replaces the runtime-hire page; Workers on disk gains Talking to a worker and the shared-copy flow contract; every example builds an installation. Resources gains resourceVisibility. The workforce, shift-manager and cli READMEs follow.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XMg2dz8sMEdyzCQTRsaMTV
…FIX-1788 P4)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XMg2dz8sMEdyzCQTRsaMTV
@linear-code

linear-code Bot commented Oct 8, 2026

Copy link
Copy Markdown

FIX-1788

@vercel

vercel Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

3 Skipped Deployments
Project Deployment Actions Updated
flow-state-dev-docs Ignored Ignored Oct 8, 2026 12:02pm UTC
flow-state-dev-kitchen-sink Ignored Ignored Oct 8, 2026 12:02pm UTC
flow-state-dev-ui Ignored Ignored Preview Oct 8, 2026 12:02pm UTC

Request Review

@cursor

cursor Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: 2d9a6974-fbc3-4c9b-82be-9ed8a449ce96)

claude added 4 commits October 8, 2026 02:07
…cked composer

The composer is blocked from the first render ("Reading the conversation first…"), so findByTestId could return before the failed read re-rendered it. Ported from 1665993 on fix/FIX-1791-coordinator-flow.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XMg2dz8sMEdyzCQTRsaMTV
…E2E on the worker model (FIX-1788 P4)

Every worker runs on the one agent copy, so a run's flowId is agent for all of them; the working row now names the worker the wake ran, read off its key. The rail and talk specs move to the worker model: the rail opens the agent kind into its one copy, a conversation starts from the roster panel's Talk, and which worker a conversation belongs to is read by the session's workerId. The rail's per-seat leaf detail is gone from the app, so its layout check goes with it; the VG check reads the roster panel.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XMg2dz8sMEdyzCQTRsaMTV
Plainer intros, refusal shapes on Hiring and forking, an approval step that is optional where it is, no undefined owner pins, a React example without await in render, what fork copies, what a worker with no resources: reaches on a shared copy, and the glossary's workforce rows. The memory wording waits on the product owner's call.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XMg2dz8sMEdyzCQTRsaMTV
…working memory per worker (FIX-1788 P4)

The product owner's call on BR-23: on the shared agent copy, long-term memory (episodic, semantic, digest) is kept per person and shared by that person's workers, never across people; skills are kept per worker and working memory per conversation.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XMg2dz8sMEdyzCQTRsaMTV
@cursor

cursor Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: 322790fe-8a33-4b9d-bc79-d8c51746379b)

@jhoffner
jhoffner marked this pull request as ready for review October 8, 2026 12:12
@cursor

cursor Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: 9f4fa630-de36-4265-993d-a94760f250c1)

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Snob — already tight. No POC.

I read packages/core/src/types/resource-visibility.ts, packages/core/src/tools/resource-tools.ts, packages/engine/src/context/dispatch-run.ts, packages/workforce/src/workers/register.ts, worker-flow.ts, installation.ts, verified-worker.ts, hire.ts (mintSeats), agent-worker-flow.ts, mailbox-post-capability.ts, mailbox/wake-member-seats.ts, worker-lookup.ts, packages/shift-manager/src/lib/workforce.ts, conversation.ts, surfaces/Roster.tsx, and apps/kitchen-sink/workforce/hire.ts.

A rewrite would not shrink the contract. reachableEntries is already the one place the visibility rule runs; isLlmWritableNow has to look the access back up because a collection instance is not a registry entry. postToMailboxFor already shares the two mailbox capabilities, and the two exports are the two callers (a minted copy signs seatId, a shared copy signs the loaded worker). seatConfigOf falls back so a minted agent copy still reads flow.config; workerConfigOf throws so a custom flow cannot silently do that — one function would drop one of those. mintSeats stays the configuration check (same words on save, hire, and turn); hireWorkforce only adds one copy per flow plus the roster flow. The unattended-board loop is the same helper on both entry points, and the attendance tests still drive mintSeats. useWorkforce is the recorded package-boundary split. standardSeats flipping standard to reuse ownSeats is a local trick, not a smaller roster contract.

Left the recorded calls alone: per-person long-term memory, standard workers only on wakes and task lookup, createSession rather than ensureWorkerSession, and FIX-1810.

Open in Web View Automation 

Sent by Cursor Automation: Code Snob

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Problem this PR solves

Durable hire, per-worker flow copies, and the roster/seat-hire stack made “add a worker” a registration and pinning ceremony. P4 flips that: workers are data, one registered copy per flow kind, and the engine refuses adoption when readonly session state (e.g. workerId) would disagree with an existing child session.

On balance this is a large net simplification (~23k lines removed). The remaining complexity is real but mostly localized (installation + per-turn resolve + resourceVisibility), not another distributed registry.


Did the approach go too far?

Mostly no for the product goal. Deleting roster/seat-hire and kitchen-sink workforce-admin is the right trade: fewer moving parts at boot, no owner pins, V9 registration story is clear (hireWorkforce → register kinds + roster flow).

Where complexity moved instead of vanished (worth tracking, not blocking):

  1. Per-turn mintSeats in resolveWorker (installation.ts ~303–323) — deliberate single path with hire/fork/edit (good for parity), but it keeps the heavy hire.ts mint pipeline on the hot path. The inline cost note helps; if this ever shows up in profiles, the cleaner follow-up is a config-only validator shared with hire blocks, not an ad-hoc cache without parity tests.

  2. Three cooperating mechanisms on one shared copy — markVerifiedWorker / seatConfigOf, flow resourceVisibility, and minted seat resources for grants. Tests give confidence; long term, document one invariant (“model tools = granted; block code = full registry”) to keep reaches() and granted aligned.

  3. Dual defineAgentWorkerFlow modes (installation set vs legacy minted copy) — branches for mailbox signing, flowConfigSchema, request.onStarted, etc. Reasonable for a phased epic; treat installation-bound as the end state and plan to narrow or gate the legacy path.


Simpler approaches considered

Alternative Upside Why this PR didn't need it
Session workerId + row read without mint Lighter hot path Loses “same refusal words as hire” unless checks are duplicated
Request-scoped config instead of WeakMap One read path WeakMap avoids cycles; keeps attribution off session state (BP-031)
hireWorkforce returns Record<kind, FlowInstance> Clearer than mergeSeatFlows Docs/naming follow-up
Engine-owned registration Fewer app steps Correctly rejected; coupling guard stays clean
Third-party registry package Less custom code Nothing generic fits FSD adoption/readonly semantics

I don't see a different top-level approach that is clearly cleaner without giving up S5/S6 or the readonly adoption guard.


Targeted simplify notes (file anchors)

  • register.ts:26 — createCheck === installation.createCheck is fragile if session is wrapped; optional symbol/tag marker.
  • register.ts:61 — as unknown as mint; small typed helper on core FlowType.
  • installation.ts:320 — broad try/catch around mint may surface programming errors as hire refusals (narrow if you've seen that in practice).
  • resource-tools.ts:38 — reachableEntries re-scans registry per tool call; memoize per request if large document maps show up in profiles.
  • agent-worker-flow.ts — installation === undefined branches are the main ongoing tax; request.onStarted → resolveTurnWorker is the right resume-safe hook (confirm no double-mint on resume if onStarted fires again).

Organization / docs (non-blocking)

workers/ is crisp; hire.ts still carries mint + seat vocabulary while registration lives next door. Package docs (mergeSeatFlows, inventory) still say “seat/hired roster” in places — easy to misread now that registered ids are flow kinds. Terminology sweep in a follow-up PR.


Verdict

Approve. Direction matches FIX-1788 P4; tests and goals moved with the cut. Notes above are follow-ups, not a request to re-architect before merge.

Open in Web View Automation 

Sent by Cursor Automation: Review For Best Approach

export function chiefOfStaffRosterTools(installation: WorkerInstallation) {
const blocks = createWorkerHireBlocks(installation);
return {
hire: sequencer({

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this a sequencer if its just one step? It can be just the step itself.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The wrapper only renames the step and gives it a description. The step itself is Workforce's workforce-hire block, which has no description. The chief of staff's tools: line calls it hire, and the agent flow refuses a catalog entry whose key doesn't match its block's own name (assertOneNamePerCatalogEntry, because that name is what the model sees and what tools: authorizes). So hire: blocks.hire would fail at startup, and the model would also get no description. Core has no way to rename or re-describe a block, so a one-step sequencer is the only way today. setWorkstreams above, already on main, is the same wrapper for the same reason.

My recommendation: keep it in this PR, and add a small core method in a follow-up. Something like block.as({ name, description }) would return the same block under a model-facing name, and this would become hire: blocks.hire.as({ name: "hire", description: "…" }). That removes hire, fire and setWorkstreams here, plus whatever else wraps for this reason. Doing it in this PR would add public core API to an already large switch and re-run its CI, and the rest of the epic is waiting on this one.

Say the word and I'll file the follow-up, or I can fold it in here if you'd rather.


Generated by Claude Code

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Filed as follow-ups:

  • FIX-1811 adds block.as({ name, description }).
  • FIX-1812, blocked by FIX-1811, sweeps the codebase for one-step rename wrappers (hire and setWorkstreams here) and replaces them.

Generated by Claude Code

jhoffner commented Oct 8, 2026

Copy link
Copy Markdown
Collaborator Author

FIX-1797 milestone (FIX-1805): green on FIX-1788's merge commit.

Shift Manager's DevTeam install, two signed-in users (Alice, Bob), real model, goal from #2864 (f920b3751).

Commit Plain m1–m5 org-scoped-workers control
028d3547c: #2866 merge (FIX-1788 P4) PASS m3 FAIL as required: Bob's roster lists Alice's worker, he reads it back by key, and his Roster screen draws it. m4 red with it, m5 PASS
f9e7b131e: main after #2865 (FIX-1791 P1) PASS ×3 m3 FAIL as required ×2, Roster screen included. m5 PASS
  • Red state: main before P4 (ea91beb49) fails m1. There's no roster flow and nothing to fork or hire.
  • Screens: every Roster-screen read waited for the person's own-worker request, 15 of 15. No absence check passed before the roster loaded.
  • Result: per D1, FIX-1791 and FIX-1795 are clear to merge on privacy. FIX-1788 still closes only after FIX-1797's final run.

Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants